package com.tao.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tao.dao.ShoppingCarDao;
import com.tao.entity.CarGood;
import com.tao.entity.ShoppingCar;
import com.tao.service.ShoppingCarService;

/**
 * 购物车 model 的实现类 
 * @author Administrator
 *
 */
@Service
public class ShoppingCarServiceImpl implements ShoppingCarService{

	@Autowired
	private ShoppingCarDao dao;

	@Override
	public int addShoppingCar(ShoppingCar shoppingCar) {
	
		return dao.addShoppingCar(shoppingCar);
	}

	@Override
	public List<CarGood> findShoppingCarById(int id) {
		
		return dao.findShoppingCarById(id);
	}

	@Override
	public List<ShoppingCar> findCarById(int id) {
		
		return dao.findCarById(id);
	}

	@Override
	public List<ShoppingCar> findCarByPid(int id) {
		return dao.findCarByPid(id);
	}

	@Override
	public int updateShoppingCar(int pid, int num) {
		return dao.updateShoppingCar(pid, num);
	}

	@Override
	public int deleteCar(List<Integer> carids) {
		return dao.deleteCar(carids);
	}

	
}
